<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script type="text/javascript" src="../js/vue.js"></script>
</head>
<body>
    
    <div id="app">
        姓：<input type="text" name="xing" v-model="xing"> <br>
        名：<input type="text" name="ming" v-model="ming"> <br>
        全称：{{ShowName()}}
    </div>

</body>
<script>
   var vm = new Vue({
       el: '#app',
       data: {
          xing:"",
          ming:""
       },
       methods:{
         ShowName:function(){
            return this.xing + '-' + this.ming
         }
       }
   })
</script>
</html>